﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DELVE_GAME.ViewStructure.MapEditor;
using Microsoft.Xna.Framework.Audio;

namespace DELVE_GAME.ViewStructure.GameActions
{
    class SaveMapGameAction : GameAction
    {
        Map map;
        MapManager manager;
        View view;
        SoundEffectInstance sound;
        public SaveMapGameAction( MapManager manager, Map map, View view, SoundEffectInstance sound)
        {
            this.map = map;
            this.manager = manager;
            this.view = view;
            this.sound = sound;
        }

        public override void doAction()
        {
            if (map.canFinalize())
            {
                sound.Play();
                manager.addMap(map);
                view.gotoStage((int)STAGES.MAIN_MENU);
            }
        }
    }
}
